\doxysection{daemon.\+h}
\hypertarget{daemon_8h_source}{}\label{daemon_8h_source}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/daemon/daemon.h@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/daemon/daemon.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ MONITOR\_H}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ MONITOR\_H}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ "{}stdint.h"{}}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ "{}string.h"{}}}
\DoxyCodeLine{00006\ }
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#define\ DAEMON\_MX\_CNT\ 64}}
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{comment}{/*\ 模块离线处理函数指针\ */}}
\DoxyCodeLine{00010\ \textcolor{keyword}{typedef}\ void\ (*offline\_callback)(\textcolor{keywordtype}{void}\ *);}
\DoxyCodeLine{00011\ }
\DoxyCodeLine{00012\ \textcolor{comment}{/*\ daemon结构体定义\ */}}
\DoxyCodeLine{00013\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\mbox{\hyperlink{structdaemon__ins}{daemon\_ins}}}
\DoxyCodeLine{00014\ \{}
\DoxyCodeLine{00015\ \ \ \ \ uint16\_t\ reload\_count;\ \ \ \ \ \textcolor{comment}{//\ 重载值}}
\DoxyCodeLine{00016\ \ \ \ \ offline\_callback\ callback;\ \textcolor{comment}{//\ 异常处理函数,当模块发生异常时会被调用}}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \ \ \ \ uint16\_t\ temp\_count;\ \textcolor{comment}{//\ 当前值,减为零说明模块离线或异常}}
\DoxyCodeLine{00019\ \ \ \ \ \textcolor{keywordtype}{void}\ *owner\_id;\ \ \ \ \ \ \textcolor{comment}{//\ daemon实例的地址,初始化的时候填入}}
\DoxyCodeLine{00020\ \}\ DaemonInstance;}
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00022\ \textcolor{comment}{/*\ daemon初始化配置\ */}}
\DoxyCodeLine{00023\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
\DoxyCodeLine{00024\ \{}
\DoxyCodeLine{00025\ \ \ \ \ uint16\_t\ reload\_count;\ \ \ \ \ \textcolor{comment}{//\ 实际上这是app唯一需要设置的值?}}
\DoxyCodeLine{00026\ \ \ \ \ uint16\_t\ init\_count;\ \ \ \ \ \ \ \textcolor{comment}{//\ 上线等待时间,有些模块需要收到主控的指令才会反馈报文,或pc等需要开机时间}}
\DoxyCodeLine{00027\ \ \ \ \ offline\_callback\ callback;\ \textcolor{comment}{//\ 异常处理函数,当模块发生异常时会被调用}}
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00029\ \ \ \ \ \textcolor{keywordtype}{void}\ *owner\_id;\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ id取拥有daemon的实例的地址,如DJIMotorInstance*,cast成void*类型}}
\DoxyCodeLine{00030\ \}\ \mbox{\hyperlink{struct_daemon___init___config__s}{Daemon\_Init\_Config\_s}};}
\DoxyCodeLine{00031\ }
\DoxyCodeLine{00038\ DaemonInstance\ *DaemonRegister(\mbox{\hyperlink{struct_daemon___init___config__s}{Daemon\_Init\_Config\_s}}\ *config);}
\DoxyCodeLine{00039\ }
\DoxyCodeLine{00045\ \textcolor{keywordtype}{void}\ DaemonReload(DaemonInstance\ *instance);}
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00053\ uint8\_t\ DaemonIsOnline(DaemonInstance\ *instance);}
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00060\ \textcolor{keywordtype}{void}\ DaemonTask();}
\DoxyCodeLine{00061\ }
\DoxyCodeLine{00062\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ !MONITOR\_H}}

\end{DoxyCode}
